package linuxbox.poll.logic;

public class BoxPollChoiceEntry
{
	protected	int m_iID = 0;
	protected int m_iPollID =0;
	protected String m_sChoice = "";

  public void copyFrom(BoxPollChoiceEntry entry)
  {
    m_iID = entry.getID();
    m_iPollID = entry.getPollID();

    if (entry.getChoice() == null)
      m_sChoice = "";
    else
      m_sChoice = new String(entry.getChoice());
  }

  public boolean equals(Object obj)
  {
    if ( obj == null )
      return false;
    BoxPollChoiceEntry entry = (BoxPollChoiceEntry) obj;
    return m_iID == entry.getID();
  }
  
	public int getID()
	{
		return m_iID;
	}
	public void setID(int id)
	{
		m_iID = id;
	}

	public int getPollID()
	{
		return m_iPollID;
	}
	public void setPollID(int id)
	{
		m_iPollID = id;
	}

  public String getChoice()
	{
    return m_sChoice;
	}
  public void setChoice(String s)
	{
    m_sChoice = s;
	}

  public String toString()
  {
    String s = "id=" + m_iID
	              + ", m_iPollID=" + m_iPollID
	              + ", m_sChoice=" + m_sChoice
                + "\n";
    return s;
  }
}
